package com.tl.app.service.impl;

import java.util.List;
import com.tl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tl.app.mapper.AppGradeUserMapper;
import com.tl.app.domain.AppGradeUser;
import com.tl.app.service.IAppGradeUserService;

/**
 * 用户等级Service业务层处理
 * 
 * @author suhp
 * @date 2024-07-07
 */
@Service
public class AppGradeUserServiceImpl implements IAppGradeUserService 
{
    @Autowired
    private AppGradeUserMapper appGradeUserMapper;

    /**
     * 查询用户等级
     * 
     * @param id 用户等级主键
     * @return 用户等级
     */
    @Override
    public AppGradeUser selectAppGradeUserById(Long id)
    {
        return appGradeUserMapper.selectAppGradeUserById(id);
    }

    /**
     * 查询用户等级列表
     * 
     * @param appGradeUser 用户等级
     * @return 用户等级
     */
    @Override
    public List<AppGradeUser> selectAppGradeUserList(AppGradeUser appGradeUser)
    {
        return appGradeUserMapper.selectAppGradeUserList(appGradeUser);
    }

    /**
     * 新增用户等级
     * 
     * @param appGradeUser 用户等级
     * @return 结果
     */
    @Override
    public int insertAppGradeUser(AppGradeUser appGradeUser)
    {
        appGradeUser.setCreateTime(DateUtils.getNowDate());
        return appGradeUserMapper.insertAppGradeUser(appGradeUser);
    }

    /**
     * 修改用户等级
     * 
     * @param appGradeUser 用户等级
     * @return 结果
     */
    @Override
    public int updateAppGradeUser(AppGradeUser appGradeUser)
    {
        appGradeUser.setUpdateTime(DateUtils.getNowDate());
        return appGradeUserMapper.updateAppGradeUser(appGradeUser);
    }

    /**
     * 批量删除用户等级
     * 
     * @param ids 需要删除的用户等级主键
     * @return 结果
     */
    @Override
    public int deleteAppGradeUserByIds(Long[] ids)
    {
        return appGradeUserMapper.deleteAppGradeUserByIds(ids);
    }

    /**
     * 删除用户等级信息
     * 
     * @param id 用户等级主键
     * @return 结果
     */
    @Override
    public int deleteAppGradeUserById(Long id)
    {
        return appGradeUserMapper.deleteAppGradeUserById(id);
    }
}
